package com.qianbei.user;

import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.widget.TextView;

import com.qianbei.R;
import com.qianbei.common.base.BaseActivity;
import com.qianbei.common.util.ConstantValue;

/**
 * 范例 activity
 *
 * Created by user on 16/5/11.
 */
public class BalanceDescriptionActivity extends BaseActivity {

    private TextView mExampleText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.acitivty_balance_description);

        setTitle(R.string.example);

        mExampleText = (TextView) findViewById(R.id.tv_example_content);

        String content = getIntent().getStringExtra(ConstantValue.CONTENT_KEY);
        String title = getIntent().getStringExtra(ConstantValue.TITLE_KEY);
        boolean isFormat = getIntent().getBooleanExtra(ConstantValue.IS_FORMAT_KEY,true);

        if (!TextUtils.isEmpty(title)){
            setTitle(title);
        }


        if(!TextUtils.isEmpty(content)){
            if (isFormat){
                mExampleText.setText(Html.fromHtml(content));
            }else{
                mExampleText.setText(content);
                mExampleText.setTextColor(getResources().getColor(R.color.color_999999));
            }

        }
    }
}
